feat(origin): run wrangler via bunx/npx when not on PATH#5
Merged
Conversation
wrangler is often installed as a project dependency rather than globally, so 'ee push'/'ee auth' failed with 'not found on PATH' even though the project could run it. Add a tool resolver that prefers a binary on PATH and falls back to a JavaScript package runner (bunx, then npx -y) for npm-based tools like wrangler, resolving the project-local install or fetching on the fly. - ResolveTool/ToolCommand centralize resolution; CheckTool and RunCommand now go through it, and cloudflare push uses ToolCommand - Improved not-found message points at both the install docs and the bunx/npx fallback - Unit tests cover PATH-first, bunx/npx fallback and ordering, and the no-runner error (lookPath is injectable for deterministic tests) - Document the fallback in the README and the ee-usage skill Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
n1rna
added a commit
that referenced
this pull request
Jul 3, 2026
Adds the bunx/npx fallback for running wrangler when it is not on PATH (#5) since v0.10.0. Bump the version string, Makefile default, and README badge accordingly. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wrangleris frequently installed as a project dependency (via npm/bun) rather than globally, soee pushandee authwould fail with'wrangler' CLI not found on PATHeven though the project could run it perfectly well. This adds an automatic fallback: when a tool isn't onPATH,eeruns it through a JavaScript package runner —bunx wranglerornpx wrangler— which resolves the project-local install (node_modules/.bin) or fetches it on the fly.Behavior
Resolution order for
wrangler:wrangleronPATH→ used directly (unchanged behavior)bunx wranglerifbunxis availablenpx -y wranglerifnpxis availableghis unaffected — it's a native binary with no npm runner, so it has no fallback.Implementation
internal/origin/toolcheck.go: newResolveTool/ToolCommandcentralize resolution.CheckToolandRunCommandnow go through it.lookPathis an injectable indirection overexec.LookPathfor deterministic tests.internal/origin/cloudflare.go: secret push (bulkandput) now build the command viaToolCommand("wrangler", ...)instead of a hardcodedexec.Command("wrangler", ...).ee-usageskill note describing the fallback.Tests / verification
toolcheck_test.go): PATH-first, bunx fallback, npx fallback, bunx-over-npx ordering, no-runner error, gh has no fallback,ToolCommandargv, and resolver-vs-exec error.go test ./...→ all pass.bunxonPATHandwranglerabsent,ee auth wranglerresolves tobunx wrangler whoamiand reports authenticated; with nothing available it prints the improved error mentioning bunx/npx.golangci-lint run→ 0 issues;gofmt/golinesclean.🤖 Generated with Claude Code